﻿using Authentication.Core.Data.DataContextStorage;
using Authentication.Model.Model;
using Common.Data.Repository;
using System.Data.Entity;

namespace Authentication.Core.Data.Repository
{
    public class AuthenticationRepository : GenericRepository
    {
        public AuthenticationRepository()
            : base(DataContextFactory.GetDataContext())
        {
        }

        private static AuthenticationRepository _current = null;
        public static AuthenticationRepository Current
        {
            get
            {
                if (_current == null)
                {
                    _current = new AuthenticationRepository();
                }
                return _current;
            }
        }
        public DbSet<ApplicationAccountRule> AccountRoles
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).AccountRules;
            }
        }
        public DbSet<Account> Accounts
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).Accounts;
            }
        }

        public DbSet<ApplicationGroup> Groups
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).Groups;
            }
        }

        public DbSet<Branch> Branchs
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).Branchs;
            }
        }
        public DbSet<DepartmentSme> DepartmentSmes
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).DepartmentSmes;
            }
        }

        public DbSet<DaoInfo> DaoInfos
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).DaoInfos;
            }
        }

        public DbSet<AccountGroupCustomer> AccountGroupCustomers
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).AccountGroupCustomers;
            }
        }
        public DbSet<ApplicationObject> Objects
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).Objects;
            }
        }
        public DbSet<ApplicationGroupRule> GroupRoles
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).GroupRules;
            }
        }
        public DbSet<ActionLog> ActionLogs
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).ActionLogs;
            }
        }
        public DbSet<UserQuestion> UserQuestions
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).UserQuestions;
            }
        }
        public DbSet<CreateDaoRequest> CreateDaoRequests
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).CreateDaoRequests;
            }
        }
        public DbSet<ChangeDaoRequest> ChangeDaoRequests
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).ChangeDaoRequests;
            }
        }
        public DbSet<ChangeDaoCif> ChangeDaoCifs
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).ChangeDaoCifs;
            }
        }
        public DbSet<ChangeDaoProduct> ChangeDaoProducts
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).ChangeDaoProducts;
            }
        }
        public DbSet<ChangeDaoProductChecked> ChangeDaoProductCheckeds
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).ChangeDaoProductCheckeds;
            }
        }
        public DbSet<CloseDaoRequest> CloseDaoRequests
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).CloseDaoRequests;
            }
        }
        public DbSet<EditDaoRequest> EditDaoRequests
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).EditDaoRequests;
            }
        }
        public DbSet<EditDaoRequestDetail> EditDaoRequestDetails
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).EditDaoRequestDetails;
            }
        }
        public DbSet<Customers> Customers
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).Customers;
            }
        }
        public DbSet<DaoCodeS16> DaoCodeS16s
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).DaoCodeS16s;
            }
        }
        public DbSet<DateBusiness> DateBusinesses
        {
            get
            {
                return ((AuthenticationEntities)this.DbContext).DateBusinesses;
            }
        }

    }
}
